<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
<c:import url="/includes/header.jsp"></c:import>
</head>
<body>
	<div class="container">
		<div class="row">
			<p>
				<input type="text" id="recordId" value="" name="record"
					placeholder="输入订单ID">
			</p>
			<div class="col-sm-6">
				<a class="btn btn-default" data-type="1">模拟接受订单</a> <a
					class="btn btn-default" data-type="2">模拟完成取货</a> <a
					class="btn btn-default" data-type="3">模拟完成订单</a> <a
					class="btn btn-default" data-type="4">模拟取消订单</a> <a
					class="btn btn-default" data-type="5">模拟订单过期</a>
			</div>
		</div>
	</div>
</body>
</html>
<script type="text/javascript">
<!--
	//-->
	$(".btn").click(function() {
		var id = $("#recordId").val();
		var type = $(this).attr("data-type");
		$.ajax({
			url : "${pageContext.request.contextPath}/admin/deliver/test.do",
			type : "post",
			dataType : "json",
			data : {
				orderId : id,
				type : type
			},
			async : false,
			success : function(data) {
				if (data.code == "0") {
					bootbox.alert("操作成功");

				} else {
					bootbox.alert("操作失败");
				}
			},
			error : function() {
				bootbox.alert("网络不稳定,添加失败");
			}
		});

	});
</script>
